﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bluyel.Core
{
    /// <summary>
    /// Base class of var and const.
    /// </summary>
    public abstract class DataNamedBase : IDataNamed
    {
        string _name;

        /// <summary>
        /// The type of the var, can be: BasicType, LOV or Physical quantity,...
        /// or a RefTo !
        /// </summary>
        IType _type;

        // set to true for constant
        //bool _isConst = false;
        VarOrConst _varOrConst = VarOrConst.Var;

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="name"></param>
        public DataNamedBase(string name, IType type)
        {
            _name = name;
            _type = type;
        }

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="name"></param>
        public DataNamedBase(string name, IType type, VarOrConst varOrConst)
        {
            _name = name;
            _type = type;

            _varOrConst = varOrConst;
        }

        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        public IType Type
        {
            get { return _type; }
            set { _type = value; }
        }

        /// <summary>
        /// Var means writeable,
        /// Const means read-only.
        /// </summary>
        public VarOrConst VarOrConst
        { get { return _varOrConst; } }
    }
}
